import time

from selenium import webdriver
from selenium.webdriver.chrome.options import Options

chrome_options = Options()
chrome_options.binary_location = r"D:\work\soft\Chrome\Application\chrome.exe"
driver = webdriver.Chrome(options=chrome_options)
driver.get("http://192.168.26.140/index.php")
driver.maximize_window()

driver.find_element_by_link_text('登录').click()
time.sleep(1)
driver.window_handles[-1]
d=driver.find_element_by_xpath('//tbody/tr[1]/td[2]/input')
d.send_keys('admin')
m=driver.find_element_by_xpath("//input[@name='password']")
m.send_keys('123456')
dl=driver.find_element_by_xpath("//input[@name='submit']")
dl.click()
time.sleep(2)
zh=driver.find_element_by_link_text('我的账户')
zh.click()
time.sleep(1)
ly=driver.find_element_by_xpath('/html/body/div[5]/div[1]/div/div/div/div/a[6]')
ly.click()
time.sleep(1)
zt=driver.find_element_by_xpath('//tbody/tr[2]/td[2]/input')
zt.send_keys('我爱吃汉堡包')
nr=driver.find_element_by_css_selector('.B_blue')
nr.send_keys('超级无敌大汉堡怕怕怕怕怕怕')
sc=driver.find_element_by_xpath('//tbody/tr[4]/td[2]/input')
sc.send_keys(r'D:\work\codind\2506pro\webzhidonghua\datas\tu.png')
driver.find_element_by_css_selector('.bnt_bonus').click()
